import request from "@/utils/request";

const baseURL = "/official-website/unit/diy";

export type DiyDetail = {
  id: string;
  diyName: string; //名称
  iconUrl: string; //标识图标URL地址
  jumpPage: string; //跳转页面地址
  sortNo: number; //排序
};

// 根据金刚区id获取金刚区详情
export const getDiyById = (id: string) => request<Res<DiyDetail>>({ url: `${baseURL}/get-diy-by-id`, method: "GET", params: id });

// 金刚区分页查询
export const getDiy = (data: PageParams & { diyName?: string }) =>
  request<Res<{ list: DiyDetail[]; total: number }>>({
    url: `${baseURL}/page`,
    method: "POST",
    data,
  });
